package cn.doitedu.day07

import org.apache.spark.sql.{DataFrame, SaveMode, SparkSession}

import java.util.Properties

//按照指定的字段创建分区表
object T18_PartitionBy {

  def main(args: Array[String]): Unit = {

    val spark = SparkSession.builder().appName(this.getClass.getSimpleName)
      .master("local[4]")
      .getOrCreate()

    //sparksql支持统一的数据访问方式
    val df: DataFrame = spark.read.parquet("data/order.snappy.parquet")

    df.write.partitionBy("dt")
      .json("out/pb")



  }

}
